home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / share / Dos / VARIOS / pascal / SWAG9605.DDD / 0044_Find text on the CRT.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-05-31  |  575 b   |  27 lines

  1. function getchr (x,y : byte) : char; assembler;
  2. asm
  3.   mov ah, 3;
  4.   xor bh, bh;
  5.   int 10h;
  6.   push dx;
  7.   mov ah, 2;
  8.   mov dl, x;
  9.   mov dh, y;
  10.   dec dl;    {Coordinates are 1 based in TP -- 0 based in asm}
  11.   dec dh;
  12.   int 10h
  13.   mov ah, 8;
  14.   int 10h;
  15.   mov ah, 2;
  16.   pop dx;
  17.   int 10h;
  18. end;
  19.  
  20. This gets a character from the screen without ultimately affecting
  21. cursor positon (it is saved and restored).  It can also be used as:
  22. getchr (wherex, wherey);
  23. to get the character at the current cursor location.
  24.  
  25. Mike Phillips
  26. INTERNET:  phil4086@utdallas.edu
  27.